﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="edjobdetail.ascx.cs" Inherits="admin_edjobdetail" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<style type="text/css">
    .style1
    {
        width: 122px;
    }
    .style2
    {
        width: 465px;
    }
</style>
<center>
<table width="100%">
    <tr>
        <td class="style1">Loại Công việc:</td>
        <td class="style2">
            <asp:DropDownList ID="ddlID" runat="server" AutoPostBack="True" 
                DataSourceID="SqlDataSource3" DataTextField="description" DataValueField="id" 
                Height="28px" Width="303px" Enabled ="false" ValidationGroup="update">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
                SelectCommand="select * from Jobs  ORDER BY [id] DESC">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlLang" DefaultValue="vn" Name="lang" />
                </SelectParameters>
            </asp:SqlDataSource>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="ddlID" ErrorMessage="*" ValidationGroup="update">Chưa chọn Loại Công việc</asp:RequiredFieldValidator>
            </td>
    </tr>
    <tr>
        <td class="style1">Ngôn ngữ: </td>
        <td class="style2">
            <asp:DropDownList ID="ddlLang" runat="server" 
                DataSourceID="SqlDataSource1" DataTextField="lang" DataValueField="id" 
                Height="27px" Width="140px" AutoPostBack="True" 
                 Enabled="false" ValidationGroup="update" >
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
                SelectCommand="SELECT * FROM [Languages]"></asp:SqlDataSource>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="ddlLang" ErrorMessage="*" ValidationGroup="update">Chưa Chọn Ngôn Ngữ</asp:RequiredFieldValidator>
            </td>
    </tr>
    <tr>
        <td class="style1">Menu: </td>
        <td class="style2">
            <asp:TextBox ID="menu" runat="server" Width="315px" ValidationGroup="update"></asp:TextBox>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="menu" ValidationGroup="update">Chưa nhập menu</asp:RequiredFieldValidator>
            </td>
    </tr>
    <tr>
        <td class="style1">Tiêu đề: </td>
        <td class="style2">
            <asp:TextBox ID="title" runat="server" Width="319px" MaxLength="5000" Rows="5" 
                TextMode="MultiLine" ValidationGroup="update"></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                ControlToValidate="title" ValidationGroup="update">Chưa nhập menu</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="style1">Miêu tả: </td>
        <td class="style2">
            <fckeditorv2:fckeditor ID="fckDes" runat="server" BasePath="~/fckeditor/">
            </fckeditorv2:fckeditor>
        </td>
        <td>
            <asp:HiddenField ID="hdfDetailID" runat="server" />

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
    UpdateCommand="UPDATE [JobsDetails] SET [menu] = @menu, [title] = @title, [description] = @description, [content] = @content, [jobsId] = @jobsId WHERE [id] = @id AND [lang] = @lang">
   
    <UpdateParameters>
        <asp:ControlParameter ControlID="menu" Name="menu" PropertyName="Text" 
            Type="String" />
        <asp:ControlParameter ControlID="title" Name="title" PropertyName="Text" 
            Type="String" />
        <asp:ControlParameter ControlID="hdfDes" Name="description" 
            PropertyName="Value" Type="String" />
        <asp:ControlParameter ControlID="hdfContent" Name="content" 
            PropertyName="Value" Type="String" />
        <asp:ControlParameter ControlID="ddlID" Name="jobsId" 
            PropertyName="SelectedValue" Type="Int64" />
        <asp:ControlParameter ControlID="hdfDetailID" Name="id" PropertyName="Value" 
            Type="Int64" />
        <asp:ControlParameter ControlID="ddlLang" Name="lang" 
            PropertyName="SelectedValue" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>


        </td>
    </tr>
    <tr>
        <td class="style1">Nội dung: </td>
        <td class="style2">
            <fckeditorv2:fckeditor ID="fckContent" runat="server" BasePath="~/fckeditor/">
            </fckeditorv2:fckeditor>
        </td>
        <td>
            <asp:HiddenField ID="hdfDes" runat="server" />
            <asp:HiddenField ID="hdfContent" runat="server" />
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td class="style2">
            <asp:Button runat="server" ID="addbt" Text="Cập nhật" 
                onclick="addbt_Click" ValidationGroup="update"/>
            </td>
        <td>&nbsp;</td>
    </tr>
</table>
</center>




